package com.direct.dao;

import com.direct.pojo.Dept;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author caixiaofeng
 * @company xxx公司科技有限公司
 * @create 2020-04-21 14:44
 */
@Mapper
@Repository
public interface DeptDao {
    /**
     * 增加部门
     *
     * @param dept
     */
    //@Insert("insert into dept (dname,db_source)values(#{dname},DATABASE())")
    void addDept(Dept dept);

    /**
     * 查询部门
     *
     * @param deptno
     * @return
     */
    //@Select("select * from dept where deptno=#{deptno}")
    Dept queryById(@Param("deptno") Long deptno);

    /**
     * 查询所有部门
     *
     * @return
     */
    //@Select("select * from dept")
    List<Dept> queryAll();
}
